Skip to content

Make command-line arguments -i "" launch the portable instance#2341

Merged
Holt59 merged 2 commits intoModOrganizer2:masterfrom
JonathanFeenstra:cmd-portable
Apr 27, 2026
Merged

Make command-line arguments -i "" launch the portable instance#2341
Holt59 merged 2 commits intoModOrganizer2:masterfrom
JonathanFeenstra:cmd-portable

Conversation

@JonathanFeenstra
Copy link
Copy Markdown
Member

@JonathanFeenstra JonathanFeenstra commented Feb 21, 2026

Closes #1633

The check for -i with no arguments doesn't distinguish between -i "" or just -i:

// handle -i with no arguments
if (m_vm.count("instance") && m_vm["instance"].as<std::string>() == "") {

So if we want -i "" to also launch the portable instance, we need to find another way to distinguish between those cases. I don't think we really need that though.

I changed it to use boost::optional so we can distinguish between those cases now. @Al12rs didn't like using -i "Portable", since there could be a global instance named "Portable".

@Silarn Silarn closed this Apr 15, 2026
@Silarn Silarn reopened this Apr 15, 2026
@JonathanFeenstra JonathanFeenstra marked this pull request as draft April 15, 2026 20:46
@JonathanFeenstra JonathanFeenstra changed the title Make command-line arguments -i "Portable" launch the portable instance Make command-line arguments -i "" launch the portable instance Apr 15, 2026
@JonathanFeenstra JonathanFeenstra marked this pull request as ready for review April 15, 2026 21:27
@Al12rs
Copy link
Copy Markdown
Member

Al12rs commented Apr 16, 2026

Were you able to test if this distinguishes between no param and empty string?

Could we use std::optional rather than the boost version or was there a reason to use boost?

@JonathanFeenstra
Copy link
Copy Markdown
Member Author

Were you able to test if this distinguishes between no param and empty string?

Yes, I confirmed it's working correctly for both -i and -i "" as command-line arguments.

Could we use std::optional rather than the boost version or was there a reason to use boost?

I tried std::optional first, but unfortunately that isn't supported by boost::program_options::variables_map because it's not a streamable type.

Copy link
Copy Markdown
Member

@Silarn Silarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm fine with this @Al12rs , do you have any more concerns?

@Al12rs
Copy link
Copy Markdown
Member

Al12rs commented Apr 27, 2026

If this was tested I'm happy with it

@Holt59 Holt59 merged commit 49da80c into ModOrganizer2:master Apr 27, 2026
3 checks passed
@JonathanFeenstra JonathanFeenstra deleted the cmd-portable branch April 27, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open portable instance from command line

4 participants